home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / chat / 12 / 12.exe / SYSTEM / PARTYLIN.ALS < prev    next >
Encoding:
Text File  |  2000-02-21  |  26.6 KB  |  860 lines

  1. partyline.boot {
  2.   if (($chkflag($gettok($1,2,46),*,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  3.   if ($3 == $null) {
  4.     sockwrite -n $1 Usage: $2 <username> [reason]
  5.     return 0
  6.   }
  7.   if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
  8.     sockwrite -n $1 Can't boot the owner.
  9.     return 0
  10.   }
  11.   if ($sock($addtok(partyline,$3,46)) != $null) {
  12.     pl.bc $addtok(partyline,$3,46) *** $gettok($1,2,46) booted $3 from the $iif($pl.var($3,channel),channel,party line) $+ $iif($4,:,.) $4-
  13.     sockwrite -n $addtok(partyline,$3,46) -=- poof -=-
  14.     sockwrite -n $addtok(partyline,$3,46) You've been booted from the $iif($pl.var($3,channel),channel,party line) by $gettok($1,2,46) $+ $iif($4,:,.) $4-
  15.     if ($sock($addtok(telnet,$3,46))) sockclose $addtok(partyline,$3,46)
  16.     else {
  17.       sockwrite -n $addtok(partyline,$3,46) Returning to interface menu...
  18.       sockrename $addtok(partyline,$3,46) $addtok(telnet,$3,46)
  19.       tel.login $addtok(telnet,$3,46) .
  20.     }
  21.     pl.clr $3
  22.     return 1
  23.   }
  24.   sockwrite -n $1 Who? No such person on the party line.
  25.   return 0
  26. }
  27. partyline.+host {
  28.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  29.   if ($3 == $null) {
  30.     sockwrite -n $1 Usage: $2 <username> <newhostmask>
  31.     return 0
  32.   }
  33.   if ($usrhost($3) == $null) {
  34.     sockwrite -n $1 No such user.
  35.     return 0
  36.   }
  37.   if ($findtok($hstmask($3),$4,1,32)) {
  38.     sockwrite -n $1 That hostmask is already there.
  39.     return 0
  40.   }
  41.   if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
  42.     sockwrite -n $1 Can't add hostmasks to the owner.
  43.     return 0
  44.   }
  45.   .auser 40 $4
  46.   .save -ru users.mrc
  47.   writeini -n users.ini $3 hostmask $hstmask($3) $4
  48.   writeini -n users.ini Users $4 $3
  49.   colupdt3 $4
  50.   sockwrite -n $1 Added ' $+ $4 $+ ' to $3
  51.   return 1
  52. }
  53. partyline.-host {
  54.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  55.   if ($3 == $null) {
  56.     sockwrite -n $1 Usage: $2 <username> <hostmask>
  57.     return 0
  58.   }
  59.   if ($usrhost($3) == $null) {
  60.     sockwrite -n $1 No such user.
  61.     return 0
  62.   }
  63.   if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
  64.     sockwrite -n $1 Can't remove hostmasks from the owner.
  65.     return 0
  66.   }
  67.   if (($findtok($hstmask($3),$4,1,32) == $null) || ($hstmask($3) == $4)) {
  68.     sockwrite -n $1 Failed.
  69.     return 0
  70.   }
  71.   .ruser 40 $4
  72.   .save -ru users.mrc
  73.   remini users.ini Users $4
  74.   writeini -n users.ini $3 hostmask $remtok($hstmask($3),$4,1,32)
  75.   colupdt3 $4
  76.   sockwrite -n $1 Removed ' $+ $4 $+ ' from $3
  77.   return 1
  78. }
  79. partyline.chattr {
  80.   if (($chkflag($gettok($1,2,46),$5,m) == $false) && ($chkflag($gettok($1,2,46),$5,n) == $false)) return -1
  81.   if ($3 == $null) {
  82.     sockwrite -n $1 Usage: $2 <username> [flags [#channel]]
  83.     return 0
  84.   }
  85.   if ($usrhost($3) == $null) {
  86.     sockwrite -n $1 No such user!
  87.     return 0
  88.   }
  89.   if ($5) {
  90.     if ($findtok($usrchans($3),$5,1,44)) set %tmp.partyline.chattr - $+ $cflags($3,$5)
  91.     else {
  92.       writeini -n users.ini $3 channels $addtok($usrchans($3),$5,44)
  93.       set %tmp.partyline.chattr -
  94.     }
  95.   }
  96.   else set %tmp.partyline.chattr - $+ $flags($3)
  97.   set %k.partyline.chattr $4
  98.   if ($chkflag($gettok($1,2,46),$null,n) == $false) set %k.partyline.chattr $removecs(%k.partyline.chattr,n,r)
  99.   if ((+ isin %k.partyline.chattr) || (- isin %k.partyline.chattr)) {
  100.     set %i.partyline.chattr 0
  101.     unset %j.partyline.chattr
  102.     :start
  103.     inc %i.partyline.chattr
  104.     if ($mid(%k.partyline.chattr,%i.partyline.chattr,1) != $null) {
  105.       if ($mid(%k.partyline.chattr,%i.partyline.chattr,1) == +) set %j.partyline.chattr +
  106.       elseif ($mid(%k.partyline.chattr,%i.partyline.chattr,1) == -) set %j.partyline.chattr -
  107.       else {
  108.         if (%j.partyline.chattr == +) set %tmp.partyline.chattr - $+ $removecs(%tmp.partyline.chattr,$mid(%k.partyline.chattr,%i.partyline.chattr,1),-) $+ $mid(%k.partyline.chattr,%i.partyline.chattr,1)
  109.         elseif (%j.partyline.chattr == -) set %tmp.partyline.chattr - $+ $removecs(%tmp.partyline.chattr,$mid(%k.partyline.chattr,%i.partyline.chattr,1),-)
  110.       }
  111.       goto start
  112.     }
  113.   }
  114.   else set %tmp.partyline.chattr - $+ %k.partyline.chattr
  115.   if ($5) {
  116.     if ($remove(%tmp.partyline.chattr,-) != $null) {
  117.       pl.checkflags $3 $cflags($3,$5) $remove(%tmp.partyline.chattr,-)
  118.       writeini -n users.ini $3 $5 $remove(%tmp.partyline.chattr,-)
  119.       pl.chkowner
  120.       colupdt2 $3
  121.       sockwrite -n $1 Flags for $3 are now + $+ $cflags($3,$5) $5
  122.       return 1
  123.     }
  124.     pl.checkflags $3 $cflags($3,$5) -
  125.     writeini -n users.ini $3 $5 -
  126.     pl.chkowner
  127.     colupdt2 $3
  128.     sockwrite -n $1 Flags for $3 are now $cflags($3,$5) $5
  129.     return 1
  130.   }
  131.   if (%k.partyline.chattr) {
  132.     if ($remove(%tmp.partyline.chattr,-) != $null) {
  133.       pl.checkflags $3 $flags($3) $remove(%tmp.partyline.chattr,-)
  134.       writeini -n users.ini $3 flags $remove(%tmp.partyline.chattr,-)
  135.       pl.chkowner
  136.       colupdt2 $3
  137.       sockwrite -n $1 Flags for $3 are now + $+ $flags($3)
  138.       return 1
  139.     }
  140.     pl.checkflags $3 $flags($3) -
  141.     writeini -n users.ini $3 flags -
  142.     pl.chkowner
  143.     colupdt2 $3
  144.     sockwrite -n $1 Flags for $3 are now $flags($3)
  145.     return 1
  146.   }
  147.   if ($flags($1) != -) sockwrite -n $1 Flags for $3 are + $+ $flags($1)
  148.   else sockwrite -n $1 Flags for $3 are -
  149.   return 1
  150. }
  151. partyline.+chrec {
  152.   if (($chkflag($gettok($1,2,46),$5,m) == $false) && ($chkflag($gettok($1,2,46),$5,n) == $false)) return -1
  153.   if ($4 == $null) {
  154.     sockwrite -n $1 Usage: $2 <username> <#channel>
  155.     return 0
  156.   }
  157.   if ($usrhost($3) == $null) {
  158.     sockwrite -n $1 No such user!
  159.     return 0
  160.   }
  161.   if ($findtok($usrchans($3),$4,1,44)) {
  162.     sockwrite -n $1 Channel record already exists!
  163.     return 0
  164.   }
  165.   writeini -n users.ini $3 channels $addtok($usrchans($3),$4,44)
  166.   writeini -n users.ini $3 $4 -
  167.   sockwrite -n $1 Added channel record for $3 in $4 $+ .
  168.   return 1
  169. }
  170. partyline.-chrec {
  171.   if (($chkflag($gettok($1,2,46),$5,m) == $false) && ($chkflag($gettok($1,2,46),$5,n) == $false)) return -1
  172.   if ($4 == $null) {
  173.     sockwrite -n $1 Usage: $2 <username> <#channel>
  174.     return 0
  175.   }
  176.   if ($usrhost($3) == $null) {
  177.     sockwrite -n $1 No such user!
  178.     return 0
  179.   }
  180.   if ($findtok($usrchans($3),$4,1,44)) {
  181.     if ($usrchans($3) == $4) remini users.ini $3 channels
  182.     else writeini -n users.ini $3 channels $remtok($usrchans($3),$4,1,44)
  183.     remini users.ini $3 $4
  184.     remini users.ini $3 infoline. [ $+ [ $4 ] ]
  185.     sockwrite -n $1 Removed channel record for $3 in $4 $+ .
  186.     return 1
  187.   }
  188.   sockwrite -n $1 No such channel record!
  189.   return 0
  190. }
  191. partyline.+user {
  192.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  193.   if ($3 == $null) {
  194.     sockwrite -n $1 Usage: $2 <username> [hostmask]
  195.     return 0
  196.   }
  197.   if ($usrhost($3)) {
  198.     sockwrite -n $1 Someone already exists by that name.
  199.     return 0
  200.   }
  201.   if ($4) set %adduser.addr $4
  202.   elseif ($address($3,3)) set %adduser.addr $address($3,3)
  203.   else {
  204.     sockwrite -n $1 No hostmask supplied and user is not online!
  205.     return 0
  206.   }
  207.   .auser 40 %adduser.addr
  208.   .save -ru users.mrc
  209.   writeini -n users.ini Users %adduser.addr $3
  210.   writeini -n users.ini $3 hostmask %adduser.addr
  211.   colupdt3 %adduser.addr
  212.   sockwrite -n $1 Added $3 ( $+ %adduser.addr $+ ) with no password or flags.
  213.   return 1
  214. }
  215. partyline.+bot {
  216.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  217.   if ($3 == $null) {
  218.     sockwrite -n $1 Usage: $2 <username> [hostmask]
  219.     return 0
  220.   }
  221.   if ($usrhost($3)) {
  222.     sockwrite -n $1 Someone already exists by that name.
  223.     return 0
  224.   }
  225.   if ($4) set %adduser.addr $4
  226.   elseif ($address($3,1)) set %adduser.addr $address($3,1)
  227.   else {
  228.     sockwrite -n $1 No hostmask supplied and user is not online!
  229.     return 0
  230.   }
  231.   .auser 40 %adduser.addr
  232.   .save -ru users.mrc
  233.   writeini -n users.ini Users %adduser.addr $3
  234.   writeini -n users.ini $3 hostmask %adduser.addr
  235.   writeini -n users.ini $3 flags b
  236.   colupdt3 %adduser.addr
  237.   sockwrite -n $1 Added bot ' $+ $3 $+ ' with no password.
  238.   return 1
  239. }
  240. partyline.-user {
  241.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  242.   if ($3 == $null) {
  243.     sockwrite -n $1 Usage: $2 <username>
  244.     return 0
  245.   }
  246.   if ($usrhost($3) == $null) {
  247.     sockwrite -n $1 Failed.
  248.     return 0
  249.   }
  250.   if ($findtok(%owner,$3,1,44)) {
  251.     sockwrite -n $1 Can't remove the owner!
  252.     return 0
  253.   }
  254.   set %i 0
  255.   :start
  256.   inc %i
  257.   if ($hstmask($3,%i)) {
  258.     .ruser 40 $hstmask($3,%i)
  259.     .timer -m 1 $mpy(%i,100) colupdt3 $hstmask($3,%i)
  260.     remini users.ini Users $hstmask($3,%i)
  261.     goto start
  262.   }
  263.   remini users.ini $3
  264.   sockwrite -n $1 Deleted $3 $+ .
  265.   return 1
  266. }
  267. partyline.-bot {
  268.   partyline.-user $1- 
  269.   return $result
  270. }
  271. partyline.chpass {
  272.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  273.   if ($3 == $null) {
  274.     sockwrite -n $1 Usage: $2 <username> [password]
  275.     return 0
  276.   }
  277.   if ($usrhost($3) == $null) {
  278.     sockwrite -n $1 No such user.
  279.     return 0
  280.   }
  281.   if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
  282.     sockwrite -n $1 Can't change the owner's password.
  283.     return 0
  284.   }
  285.   if ($4) {
  286.     if ($len($4) <= 3) {
  287.       sockwrite -n $1 Please use at least 4 characters.
  288.       return 0
  289.     }
  290.     crypt 0 $lower($3) $4
  291.     writeini -n users.ini $3 password $result
  292.     sockwrite -n $1 Changed password.
  293.     return 3
  294.   }
  295.   remini users.ini $3 password
  296.   sockwrite -n $1 Removed password.
  297.   return 1
  298. }
  299. partyline.chbotpass {
  300.   if (($chkflag($gettok($1,2,46),$null,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  301.   if ($3 == $null) {
  302.     sockwrite -n $1 Usage: $2 <username> [password]
  303.     return 0
  304.   }
  305.   if ($usrhost($3) == $null) {
  306.     sockwrite -n $1 No such user.
  307.     return 0
  308.   }
  309.   if ($4) {
  310.     crypt 0 $lower($3) $4
  311.     writeini -n users.ini $3 botpass $result
  312.     sockwrite -n $1 Changed bot password.
  313.     return 3
  314.   }
  315.   remini users.ini $3 botpass
  316.   sockwrite -n $1 Removed bot password.
  317.   return 1
  318. }
  319. partyline.chinfo {
  320.   if (($chkflag($gettok($1,2,46),*,m) == $false) && ($chkflag($gettok($1,2,46),*,n) == $false)) return -1
  321.   if ($3 == $null) {
  322.     sockwrite -n $1 Usage: $2 <username> [channel] <new-info>
  323.     return 0
  324.   }
  325.   if ($usrhost($3) == $null) {
  326.     sockwrite -n $1 No such user.
  327.     return 0
  328.   }
  329.   if (($findtok(%owner,$3,1,44)) && ($gettok($1,2,46) != $3)) {
  330.     sockwrite -n $1 Can't change info for the owner.
  331.     return 0
  332.   }
  333.   if ($findtok($usrchans($3),$4,1,44)) {
  334.     if ($5) {
  335.       writeini -n users.ini $3 infoline. [ $+ [ $4 ] ] $strip($5-)
  336.       sockwrite -n $1 New info for $3 on $4 $+ : $strip($5-)
  337.       return 4
  338.     }
  339.     remini users.ini $3 infoline. [ $+ [ $4 ] ]
  340.     sockwrite -n $1 Wiped info for $3 on $4
  341.     return 1
  342.   }
  343.   if ($4) {
  344.     writeini -n users.ini $3 infoline $strip($4-)
  345.     sockwrite -n $1 New default info for $3 $+ : $strip($4-)
  346.     return 3
  347.   }
  348.   remini users.ini $3 infoline
  349.   sockwrite -n $1 Wiped default info for $3
  350.   return 1
  351. }
  352. partyline.jump {
  353.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  354.   sockwrite -n $1 Jumping servers...
  355.   if ($server) quit changing servers
  356.   server $3
  357.   return 1
  358. }
  359. partyline.save {
  360.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  361.   pl.fbc m *** Writing user file...
  362.   .save -ru users.mrc
  363.   pl.fbc m *** Writing variables...
  364.   .save -rv vars.mrc
  365.   return 1
  366. }
  367. partyline.+chan {
  368.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  369.   if ($3 == $null) {
  370.     sockwrite -n $1 Usage: $2 <#channel>
  371.     return 0
  372.   }
  373.   if ($findtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,1,44)) {
  374.     if ($me !ison $3) {
  375.       join $2
  376.       return 1
  377.     }
  378.     sockwrite -n $1 That channel already exists!
  379.     return 0
  380.   }
  381.   set %autojoin. [ $+ [ %irc.network ] ] $addtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,44)
  382.   join $3
  383.   return 1
  384. }
  385. partyline.-chan {
  386.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  387.   if ($3 == $null) {
  388.     sockwrite -n $1 Usage: $2 <#channel>
  389.     return 0
  390.   }
  391.   if ($findtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,1,44)) {
  392.     set %autojoin. [ $+ [ %irc.network ] ] $remtok(%autojoin. [ $+ [ %irc.network ] ] ,$3,44)
  393.     sockwrite -n $1 Channel $3 removed.
  394.     part $3
  395.     return 1
  396.   }
  397.   if ($me ison $3) {
  398.     part $3
  399.     return 1
  400.   }
  401.   sockwrite -n $1 That channel doesn't exist!
  402.   return 0
  403. }
  404. partyline.dump {
  405.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  406.   if ($3 == $null) {
  407.     sockwrite -n $1 Usage: $2 <server stuff>
  408.     return 0
  409.   }
  410.   if ($server) .quote $3-
  411.   return 1
  412. }
  413. partyline.simul {
  414.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  415.   if ($3 == $null) {
  416.     sockwrite -n $1 Usage: $2 <nick> <text>
  417.     return 0
  418.   }
  419.   if ($sock($addtok(partyline,$3,46))) {
  420.     .timer 1 0 pl.parse $addtok(partyline,$3,46) $4-
  421.     return 1
  422.   }
  423.   sockwrite -n $1 No such person on the party line.
  424.   return 0
  425. }
  426. partyline.die {
  427.   if ($chkflag($gettok($1,2,46),*,n) == $false) return -1
  428.   if ($3) sockwrite -n partyline.* *** ircN SHUTDOWN ( $+ $gettok($1,2,46) $+ : $3- $+ )
  429.   else sockwrite -n partyline.* *** ircN SHUTDOWN (authorized by $gettok($1,2,46) $+ )
  430.   pl.fbc m *** Writing user file...
  431.   .save -ru users.mrc
  432.   pl.fbc m *** Writing variables...
  433.   .save -rv vars.mrc
  434.   if ($3) exit -y $3-
  435.   else exit -y $gettok($1,2,46)
  436.   return 1
  437. }
  438. partyline.chat {
  439.   if ($3 == on) {
  440.     if ($pl.var($gettok($1,2,46),channel) == $null) {
  441.       pl.set $gettok($1,2,46) channel 0
  442.       sockwrite -n $1 Entering the party line...
  443.       pl.bc $1 *** $gettok($1,2,46) joined the party line.
  444.       return 1
  445.     }
  446.     sockwrite -n $1 You're already on the partyline!
  447.     return 0
  448.   }
  449.   if ($3 == off) {
  450.     if ($pl.var($gettok($1,2,46),channel) != $null) {
  451.       sockwrite -n $1 Leaving chat mode...
  452.       if ($pl.var($gettok($1,2,46),channel) == 0) pl.bc $1 *** $gettok($1,2,46) left the party line.
  453.       else pl.bc $1 *** $gettok($1,2,46) has left the channel.
  454.       pl.unset $gettok($1,2,46) channel $3
  455.       return 1
  456.     }
  457.     sockwrite -n $1 You weren't in chat anyway!
  458.     return 0
  459.   }
  460.   if (($3 == $null) || ($3 == 0)) {
  461.     if ($pl.var($gettok($1,2,46),channel) != 0) {
  462.       if ($pl.var($gettok($1,2,46),channel) != $null) pl.bc $1 *** $gettok($1,2,46) left the channel.
  463.       pl.set $gettok($1,2,46) channel 0
  464.       sockwrite -n $1 Entering the party line...
  465.       pl.bc $1 *** $gettok($1,2,46) joined the party line.
  466.       return 1
  467.     }
  468.     sockwrite -n $1 You're already on the party line!
  469.     return 0
  470.   }
  471.   if ($3 isnum 1-99999) {
  472.     if ($pl.var($gettok($1,2,46),channel) == $3) {
  473.       sockwrite -n $1 You're already on channel $3 $+ !
  474.       return 0
  475.     }
  476.     if ($pl.var($gettok($1,2,46),channel) == 0) pl.bc $1 *** $gettok($1,2,46) left the party line.
  477.     else pl.bc $1 *** $gettok($1,2,46) left the channel.
  478.     pl.set $gettok($1,2,46) channel $3
  479.     sockwrite -n $1 Joining channel ' $+ $3 $+ '...
  480.     pl.bc $1 *** $gettok($1,2,46) joined the channel.
  481.     return 1
  482.   }
  483.   if ($3 isnum) {
  484.     sockwrite -n $1 Channel number out of range: must be between 0 and 99999.
  485.     return 0
  486.   }
  487.   if ($3) {
  488.     sockwrite -n $1 No channel by that name.
  489.     return 0
  490.   }
  491. }
  492. partyline.away {
  493.   if ($3 == $null) {
  494.     if ($pl.var($gettok($1,2,46),away) == $null) {
  495.       sockwrite -n $1 You weren't away!
  496.       return 0
  497.     }
  498.     pl.unset $gettok($1,2,46) away
  499.     sockwrite -n $1 You have returned.
  500.     pl.bc $1 *** $gettok($1,2,46) is no longer away.
  501.     return 1
  502.   }
  503.   pl.set $gettok($1,2,46) away $strip($3-)
  504.   pl.bc $1 *** $gettok($1,2,46) is now away: $strip($3-)
  505.   return 1
  506. }
  507. partyline.whom {
  508.   if ($pl.var($gettok($1,2,46),channel) == $null) return -2
  509.   if ($4 isnum 0-99999) set %tmp $4
  510.   elseif ($4 isnum) {
  511.     sockwrite -n $1 Channel number out of range: must be 0-99999
  512.     return 0
  513.   }
  514.   elseif ($4) {
  515.     sockwrite -n $1 No such channel.
  516.     return 0
  517.   }
  518.   else set %tmp $pl.var($gettok($1,2,46),channel)
  519.   sockwrite -n $1 $fix(12,Nick) $fix(10,Bot) Host
  520.   sockwrite -n $1 $fix(12,----------) $fix(10,---------) ------------------------------
  521.   set %i 0
  522.   :loop
  523.   inc %i
  524.   set %dcnick $gettok($sock(partyline.*,%i),2,46)
  525.   if (%dcnick) {
  526.     if (($pl.var(%dcnick,channel) == %tmp) || (%tmp == *)) {
  527.       sockwrite -n $1 $fix(12,$pl.whom(%dcnick)) $fix(10,$me) telnet: $+ $sock(partyline.*,%i).ip [idle $rsc($duration($sub($ctime,$pl.var(%dcnick,idle)))) $+ ]]
  528.       if ($pl.var(%dcnick,away) != $null) sockwrite -n $1 $lfix(8,AWAY:) $pl.var(%dcnick,away)
  529.     }
  530.     goto loop
  531.   }
  532.   return 1
  533. }
  534. partyline.whois {
  535.   if ($3 == $null) {
  536.     sockwrite -n $1 Usage: $2 <username>
  537.     return 0
  538.   }
  539.   if ($usrhost($3) == $null) {
  540.     sockwrite -n $1 Can't find anyone matching that.
  541.     return 0
  542.   }
  543.   if ($readini users.ini $3 password != $null) set %uwhois.pass yes
  544.   else set %uwhois.pass no
  545.   if ($readini users.ini $3 botpass != $null) set %uwhois.bpass yes
  546.   else set %uwhois.bpass no
  547.   set %uwhois.notes N/A
  548.   set %uwhois.seen $readini -n users.ini $3 seen
  549.   :begin
  550.   sockwrite -n $1 $fix(9,HANDLE) PASS BOTPASS NOTES $fix(17,FLAGS) LAST
  551.   sockwrite -n $1 $fix(9,$3) $fix(4,%uwhois.pass) $fix(7,%uwhois.bpass) $fix(5,%uwhois.notes) $fix(17,$iif($flags($3),$flags($3),-)) $iif(%uwhois.seen,$asctime($gettok(%uwhois.seen,1,32),h:nntt),never)
  552.   set %i 0
  553.   :flags
  554.   inc %i
  555.   if ($gettok($usrchans($3),%i,44)) {
  556.     sockwrite -n $1   $fix(26,$gettok($usrchans($3),%i,44)) $iif($cflags($3,$gettok($usrchans($3),%i,44)),$cflags($3,$gettok($usrchans($3),%i,44)),-)
  557.     if ($infoline($3,$gettok($usrchans($3),%i,44))) sockwrite -n $1  #INFO: $infoline($3,$gettok($usrchans($3),%i,44))
  558.     goto flags
  559.   }
  560.   set %i 0
  561.   :hosts
  562.   inc %i
  563.   set %uwhois.host $hstmask($3,%i)
  564.   if (%uwhois.host != $null) {
  565.     sockwrite -n $1 $iif(%i == 1,$lfix(8,HOSTS:),$fix(8,)) %uwhois.host
  566.     goto hosts
  567.   }
  568.   if ($infoline($3)) %uwhois.cmd $lfix(7,INFO:) $infoline($3)
  569.   unset %uwhois.*
  570.   return 1
  571. }
  572. partyline.me {
  573.   if ($pl.var($gettok($1,2,46),channel) == $null) return -2
  574.   if ($3 == $null) {
  575.     sockwrite -n $1 Usage: $2 <action>
  576.     return 0
  577.   }
  578.   if ($pl.var($gettok($1,2,46),away)) partyline.away $1 .away
  579.   pl.bc $1 * $gettok($1,2,46) $3-
  580.   pl.set $gettok($1,2,46) idle $ctime
  581.   return 0
  582. }
  583. partyline.say {
  584.   if ($pl.var($gettok($1,2,46),channel) == $null) return -2
  585.   if ($pl.var($gettok($1,2,46),away)) partyline.away $1 .away
  586.   if ($3 == ACTION) pl.bc $1 * $gettok($1,2,46) $getleft($4-)
  587.   else pl.bc $1 < $+ $gettok($1,2,46) $+ > $3-
  588.   pl.set $gettok($1,2,46) idle $ctime
  589.   return 0
  590. }
  591. partyline.echo {
  592.   if ($3 == $null) {
  593.     sockwrite -n $1 Usage: $2 <on/off>
  594.     return 0
  595.   }
  596.   if ($3 == on) {
  597.     pl.set $gettok($1,2,46) echo on
  598.     sockwrite -n $1 Echo turned on.
  599.     return 1
  600.   }
  601.   if ($3 == off) {
  602.     pl.set $gettok($1,2,46) echo off
  603.     sockwrite -n $1 Echo turned off.
  604.     return 1
  605.   }
  606.   sockwrite -n $1 Echo is currently $pl.var($gettok($1,2,46),echo) $+ .
  607.   return 0
  608. }
  609. partyline.help {
  610.   if ($3 == $null) {
  611.     sockwrite -n $1 DCC COMMANDS for $me $+ , %iver $+ :
  612.     qplay -s $td(help.txt) chelp $readini $td(help.txt) chelp n sockwrite -n $1
  613.     if ($chkflag($gettok($1,2,46),*,m)) qplay -s $td(help.txt) mhelp $readini $td(help.txt) mhelp n sockwrite -n $1
  614.     if ($chkflag($gettok($1,2,46),*,n)) qplay -s $td(help.txt) nhelp $readini $td(help.txt) nhelp n sockwrite -n $1
  615.     sockwrite -n $1 All commands begin with '.' and all else goes to the party line.
  616.     if ($chkflag($gettok($1,2,46),*,m)) sockwrite -n $1 Text starting with ',' is sent ONLY to masters.
  617.     sockwrite -n $1 You can get help on individual commands: '.help <command>'
  618.     return 1
  619.   }
  620.   if ($readini $td(help.txt) $3 n != $null) {
  621.     qplay -s $td(help.txt) $3 $readini $td(help.txt) $3 n sockwrite -n $1
  622.     return 1
  623.   }
  624.   sockwrite -n $1 No help available on that.
  625.   return 0
  626. }
  627. partyline.timestamp {
  628.   if ($3 == $null) {
  629.     sockwrite -n $1 Usage: $2 <on/off>
  630.     return 0
  631.   }
  632.   if ($3 == on) {
  633.     pl.set $gettok($1,2,46) timestamp on
  634.     sockwrite -n $1 Timestamp turned on.
  635.     return 1
  636.   }
  637.   if ($3 == off) {
  638.     pl.set $gettok($1,2,46) timestamp off
  639.     sockwrite -n $1 Timestamp turned off.
  640.     return 1
  641.   }
  642.   sockwrite -n $1 Timestamp is currently $pl.var($gettok($1,2,46),timestamp) $+ .
  643.   return 0
  644. }
  645. partyline.quit {
  646.   pl.bc $1 *** $gettok($1,2,46) left the party line $+ $iif($3,:,.) $3-
  647.   sockwrite -n $1 *** Ja mata!
  648.   pl.clr $gettok($1,2,46)
  649.   if ($sock($puttok($1,telnet,1,46))) {
  650.     sockclose $1
  651.     return 1
  652.   }
  653.   sockwrite -n $1 Returning to interface menu...
  654.   sockrename $1 $puttok($1,telnet,1,46)
  655.   tel.login $puttok($1,telnet,1,46) .
  656.   return 1
  657. }
  658. partyline.notes sockwrite -n $1 Command not implemented. | return 0
  659. partyline.note sockwrite -n $1 Command not implemented. | return 0
  660. partyline.files sockwrite -n $1 There is no file transfer area. | return 0
  661. partyline.newpass {
  662.   if ($3 == $null) {
  663.     sockwrite -n $1 Usage: $2 <newpassword>
  664.     return 0
  665.   }
  666.   if ($3) {
  667.     if ($len($3) <= 3) {
  668.       sockwrite -n $1 Please use at least 4 characters.
  669.       return 0
  670.     }
  671.     crypt 0 $lower($gettok($1,2,46)) $3
  672.     writeini -n users.ini $gettok($1,2,46) password $result
  673.     sockwrite -n $1 Changed password to ' $+ $3 $+ '
  674.     return 2
  675.   }
  676. }
  677. partyline.motd {
  678.   qplay -f $td(cmotd.txt) sockwrite -n $1
  679.   return 1
  680. }
  681. partyline.info {
  682.   if ($3 == $null) {
  683.     sockwrite -n $1 Usage: $2 [channel] <info line/none>
  684.     return 0
  685.   }
  686.   if ($findtok($usrchans($gettok($1,2,46)),$3,1,44)) {
  687.     if ($4 == none) {
  688.       remini users.ini $gettok($1,2,46) infoline. [ $+ [ $3 ] ]
  689.       sockwrite -n $1 Removed your info line on $3 $+ .
  690.       return 1
  691.     }
  692.     if ($4) {
  693.       writeini -n users.ini $gettok($1,2,46) infoline. [ $+ [ $3 ] ] $4-
  694.       sockwrite -n $1 Info on $3 $+ : $4-
  695.       sockwrite -n $1 Use '.info $3 none' to remove it/
  696.       return 3
  697.     }
  698.   }
  699.   if ($3 == none) {
  700.     remini users.ini $gettok($1,2,46) infoline
  701.     sockwrite -n $1 Removed your default info line.
  702.     return 1
  703.   }
  704.   writeini -n users.ini $gettok($1,2,46) infoline $3-
  705.   sockwrite -n $1 Default info: $3-
  706.   sockwrite -n $1 Use '.info none' to remove it/
  707.   return 2
  708. }
  709. partyline.su {
  710.   if ($3 == $null) {
  711.     sockwrite -n $1 Usage: $2 <username>
  712.     return 0
  713.   }
  714.   if ($hstmask($3) == $null) {
  715.     sockwrite -n $1 No such user.
  716.     return 0
  717.   }
  718.   if ($sock($addtok(partyline,$3,46))) {
  719.     sockwrite -n $1 User is already in the partyline. You may not .su to them
  720.     return 0
  721.   }
  722.   if ($sock($addtok($addtok(su,$3,46),*,46))) {
  723.     sockwrite -n $1 Someone is already attempting to .su to that user. You may not .su to them
  724.     return 0
  725.   }
  726.   if ($password($3) == $null) {
  727.     sockwrite -n $1 No password set for user. You may not .su to them
  728.     return 0
  729.   }
  730.   partyline.chat $1 .chat off
  731.   pl.clr $gettok($1,2,46)
  732.   if (($chkflag($gettok($1,2,46),*,n)) && ($chkflag($3,*,n) == $false)) {
  733.     sockrename $1 $addtok(partyline,$3,46)
  734.     pl.login $addtok(partyline,$3,46)
  735.     return 1
  736.   }
  737.   sockwrite -n $1 $crlf $+ Enter your password.
  738.   sockrename $1 $addtok($addtok(su,$3,46),$gettok($1,2,46),46)
  739.   return 1
  740. }
  741. partyline.+ban {
  742.   if ($chkflag($gettok($1,2,46),*,o) == $false) return -1
  743.   if (%userbans == off) {
  744.     sockwrite -n $1 Access denied.
  745.     return 0
  746.   }
  747.   if ($3 == $null) {
  748.     sockwrite -n $1 Usage: $2 <hostmask> [channel] [reason]
  749.     return 0
  750.   }
  751.   if ($ulist($3,20,0)) {
  752.     sockwrite -n $1 A matching ban already exists!
  753.     return 0
  754.   }
  755.   if ($me ison $4) set %banchans $4
  756.   else set %banchans all
  757.   if ($5) {
  758.     if ($me ison $4) set %reason $gettok($1,2,46) $+ : $5-
  759.     else set %reason $gettok($1,2,46) $+ : $4-
  760.   }
  761.   else set %reason $gettok($1,2,46) $+ : request
  762.   if ($chkflag($gettok($1,2,46),$iif(%banchans == all,$null,%banchans),o) == $false) {
  763.     if (%banchans == all) sockwrite -n $1 Can't place global ban
  764.     else sockwrite -n $1 Can't place ban in %banchans
  765.     return 0
  766.   }
  767.   writeini -n bans.ini $3 reason %reason
  768.   writeini -n bans.ini $3 channels %banchans
  769.   .auser 20 $3
  770.   .save -ru users.mrc
  771.   colupdt3 $3
  772.   sockwrite -n $1 New $iif(%banchans == all,global,%banchans) ban: $3 $paren(%reason)
  773.   if (%banchans == all) set %banchans $mychans
  774.   unset %tmp
  775.   set %i 0
  776.   :start
  777.   inc %i
  778.   if ($gettok(%banchans,%i,44)) {
  779.     if ($me isop $gettok(%banchans,%i,44)) set %tmp %tmp $+ $crlf $+ mode $gettok(%banchans,%i,44) b $3
  780.     goto start
  781.   }
  782.   if (%tmp) .quote %tmp
  783.   unset %reason %banchans %tmp
  784.   return 1
  785. }
  786. partyline.-ban {
  787.   if ($chkflag($gettok($1,2,46),*,o) == $false) return -1
  788.   if (%userbans == off) {
  789.     sockwrite -n $1 Access denied.
  790.     return 0
  791.   }
  792.   if ($3 == $null) {
  793.     sockwrite -n $1 Usage: $2 <hostmask/ban #>
  794.     return 0
  795.   }
  796.   if ($3 isnum) set %tmp2 $ulist(*,20,$3)
  797.   else set %tmp2 $ulist($3,20,1)
  798.   if ($chkflag($gettok($1,2,46),$usrchans($ulist(*,20,$3)),o) == $false) {
  799.     sockwrite -n $1 Can't remove ban.
  800.     return 0
  801.   }
  802.   if (%tmp2) {
  803.     set %banchans $usrchans(%tmp2)
  804.     remini bans.ini %tmp2
  805.     .timer 1 0 colupdt3 %tmp2
  806.     .ruser 20 %tmp2
  807.     .save -ru users.mrc
  808.     sockwrite -n $1 Removed ban: %tmp2
  809.     if (%banchans == all) set %banchans $mychans
  810.     unset %tmp
  811.     set %i 0
  812.     :start
  813.     inc %i
  814.     if ($gettok(%banchans,%i,44)) {
  815.       if ($me isop $gettok(%banchans,%i,44)) set %tmp %tmp $+ $crlf $+ mode $gettok(%banchans,%i,44) -b %tmp2
  816.       goto start
  817.     }
  818.     if (%tmp) .quote %tmp
  819.     return 1
  820.   }
  821.   sockwrite -n $1 No such ban: $1
  822.   return 0
  823. }
  824. partyline.bans {
  825.   if ($chkflag($gettok($1,2,46),*,o) == $false) return -1
  826.   if (%userbans == off) {
  827.     sockwrite -n $1 Access denied.
  828.     return 0
  829.   }
  830.   if ($ulist(*,20,0)) sockwrite -n $1 Recorded bans:
  831.   else sockwrite -n $1 No bans recorded.
  832.   set %i 0
  833.   :start
  834.   inc %i
  835.   if ($ulist(*,20,%i)) {
  836.     sockwrite -n $1 $lfix(3,[) $+ $lfix(3,%i) $+ ] $ulist(*,20,%i) (perm)
  837.     sockwrite -n $1 $fix(5,) $readini bans.ini $ulist(*,20,%i) reason
  838.     sockwrite -n $1 $fix(5,) Channels: $readini bans.ini $ulist(*,20,%i) channels
  839.     goto start
  840.   }
  841.   return 1
  842. }
  843. partyline.remote {
  844.   if (%icontrol == off) {
  845.     sockwrite -n $1 Remote control is disabled.
  846.     return 0
  847.   }
  848.   if ($chkflag($gettok($1,2,46),$null,r) == $false) {
  849.     sockwrite -n $1 Access denied.
  850.     return 0
  851.   }
  852.   if ($sock($puttok($1,remote,1,46))) {
  853.     sockwrite -n $1 You are already in the remote control interface!
  854.     return 0
  855.   }
  856.   partyline.chat $1 .chat off
  857.   sockrename $1 $puttok($1,remote,1,46)
  858.   rc.login $puttok($1,remote,1,46)
  859. }
  860.